Skip to content

Conversation

@herrwang0
Copy link

@herrwang0 herrwang0 commented Dec 13, 2025

This PR adds a new 2D field meanSL to grid control structure. meanSL is primarily used to handle a domain with spatially uneven long term mean surface level, with the Great Lakes being a prime example.

  • As bathyT, meanSL is referenced to z_ref in ocean_grid_type (and to zero in dyn_horgrid_type). meanSL adopts height unit and is positive above z_ref or zero.
  • Cosmetically, the expression G%meanSL + G%bathyT in calculating column thickness is used instead of G%bathyT + G%meanSL, which (hopefully) can be easily interpreted as G%meanSL - (-G%bathyT).
  • meanSL is NOT replacing z_ref.
    1. So that z_ref can still be used as a uniform reference height for debugging/testing.
    2. If we instead turn z_ref into as a 2D field, topography will have to change to column thickness, which may not be very user-friendly.
  • Why not use a mean thickness?
    1. Mean thickness could reduce a lot of max(meanSL+bathyT, 0.0) operations, but majority of the mean thickness calculation happens in _init, so this is probably not a lot of extra work. The exception is find_face_area under certain configurations in barotropic solver.
    2. mean sea level = difference of two large numbers. (though we don't actually use grad(meanSL)).
  • This affects 14 modules. By default, meanSL is uniformly zero (or z_ref internally), so there is no answer change.
  • The three commits are meant to separate the introduction of meanSL and the actual usage of meanSL.

Edit: sorry for claiming the #1000 issue/pr/discussion.

Copy link
Member

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my view, this PR will be ready to go once the instance of an inappropriate use of array syntax math (noted in a specific comment on the line in question) has been addressed.

Copy link
Member

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the recent minor corrections, I think that these changes are all correct. Thank you for the addition of this valuable new capability.

The spatially varying time mean sea level meanSL is used as a reference
height to calculate, e.g., time mean ocean column thickness
max(meanSL + bathyT, 0.0). This field allows the model run in a domain
with spatically varying mean height, e.g. the Great Lakes system.

This first commit insulates the changes from the rest of the model. It
only adds the field to ocean_grid_type and dyn_horgrid_type, the
transcription between the two types, and a routine to read it from a
file. The field is not yet used by the rest of the code.
This commit uses G%meanSL in 13 modules. The change is essentially
replacing G%bathyT + G%Z_ref with G%meanSL + G%bathyT. Note that this
does NOT mean parameter G%Z_ref is replaced by G%meanSL. G%Z_ref is
factored in both G%meanSL and G%bathyT and it is kept as a useful
consistency testing tool.

Another cosmetic change is made by using G%meanSL + G%bathyT, instead of
G%bathyT + G%meanSL, which (hopefully) can be easily interpreted as
G%meanSL - (-G%bathyT).
max_depth is really used as a maximum static thickness throughout the
model, so meanSL needs to be considered.
@Hallberg-NOAA
Copy link
Member

This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/29846.

@Hallberg-NOAA Hallberg-NOAA merged commit cbcc012 into NOAA-GFDL:dev/gfdl Jan 14, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants